package com.gp.pj.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gp.pj.entity.Employee;
import com.gp.pj.mapper.EmployeeMapper;
import com.gp.pj.service.EmployeeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gp.pj.utils.ResultUtils;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Chloe
 * @since 2020-12-07
 */
@Service
public class EmployeeServiceImpl extends ServiceImpl<EmployeeMapper, Employee> implements EmployeeService {

    @Override
    public ResultUtils getStudentList() {
        IPage<Employee> page = new Page<>();
        IPage<Employee> student = this.page(page, Wrappers.<Employee>lambdaQuery().eq(Employee::getType, "student"));
        return ResultUtils.success(student);
    }

    @Override
    public ResultUtils getTeacherList() {
        IPage<Employee> page = new Page<>();
        IPage<Employee> student = this.page(page, Wrappers.<Employee>lambdaQuery().eq(Employee::getType, "teacher"));
        return ResultUtils.success(student);
    }

}
